package com.sunny.wordstudy;

import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.net.Uri;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Environment;
import android.os.Process;
import android.preference.PreferenceManager;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import com.sunny.dict.MDict;
import com.sunny.wordstudy.lib.Stat;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.lang.reflect.Field;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class Word extends Activity
{
  bn A;
  String B;
  boolean C = false;
  AdapterView.OnItemClickListener D = new bo(this);
  final int E = 0;
  final int F = 1;
  final int G = 2;
  final int H = 3;
  final int I = 4;
  final int a = 1;
  final int b = 2;
  final int c = 3;
  final int d = 4;
  final int e = 0;
  final int f = 1;
  final int g = 2;
  final int h = 1;
  final int i = 2;
  final int j = 3;
  final int k = 4;
  final int l = 5;
  Stat m = Stat.a();
  int n = 1;
  int o = 0;
  String p = "";
  String q;
  String r;
  String s;
  String t;
  String u;
  ListView v;
  List w;
  AlertDialog.Builder x = null;
  AlertDialog.Builder y = null;
  ProgressDialog z = null;

  private void a(boolean paramBoolean)
  {
    this.v = ((ListView)findViewById(2131230740));
    String[] arrayOfString = new String[3];
    arrayOfString[0] = "pic";
    arrayOfString[1] = "title";
    arrayOfString[2] = "desc";
    int[] arrayOfInt = new int[3];
    arrayOfInt[0] = 2131230741;
    arrayOfInt[1] = 2131230742;
    arrayOfInt[2] = 2131230743;
    ArrayList localArrayList = new ArrayList();
    HashMap localHashMap1 = new HashMap();
    localHashMap1.put("id", "study");
    localHashMap1.put("title", getResources().getString(2131099764));
    localHashMap1.put("desc", getResources().getString(2131099765));
    localHashMap1.put("pic", Integer.valueOf(2130837519));
    localArrayList.add(localHashMap1);
    HashMap localHashMap2 = new HashMap();
    localHashMap2.put("id", "test");
    localHashMap2.put("title", getResources().getString(2131099766));
    localHashMap2.put("desc", getResources().getString(2131099767));
    localHashMap2.put("pic", Integer.valueOf(2130837520));
    localArrayList.add(localHashMap2);
    HashMap localHashMap3 = new HashMap();
    localHashMap3.put("id", "choosedb");
    localHashMap3.put("title", getResources().getString(2131099780));
    localHashMap3.put("desc", getResources().getString(2131099781));
    localHashMap3.put("pic", Integer.valueOf(2130837513));
    localArrayList.add(localHashMap3);
    new File("/sdcard/wordstudy/dict.edb");
    HashMap localHashMap4 = new HashMap();
    localHashMap4.put("id", "dict");
    localHashMap4.put("title", getResources().getString(2131099778));
    localHashMap4.put("desc", getResources().getString(2131099779));
    localHashMap4.put("pic", Integer.valueOf(2130837514));
    localArrayList.add(localHashMap4);
    if ((!(paramBoolean)) && (this.m.b() <= 0))
    {
      HashMap localHashMap8 = new HashMap();
      localHashMap8.put("id", "buyapp");
      localHashMap8.put("title", getResources().getString(2131099770));
      localHashMap8.put("desc", getResources().getString(2131099771));
      localHashMap8.put("pic", Integer.valueOf(2130837516));
      localArrayList.add(localHashMap8);
    }
    HashMap localHashMap5 = new HashMap();
    localHashMap5.put("id", "spread");
    localHashMap5.put("title", getResources().getString(2131099776));
    localHashMap5.put("desc", getResources().getString(2131099777));
    localHashMap5.put("pic", Integer.valueOf(2130837518));
    localArrayList.add(localHashMap5);
    HashMap localHashMap6 = new HashMap();
    localHashMap6.put("id", "more");
    localHashMap6.put("title", getResources().getString(2131099784));
    localHashMap6.put("desc", getResources().getString(2131099785));
    localHashMap6.put("pic", Integer.valueOf(2130837515));
    localArrayList.add(localHashMap6);
    if (("".equals("")) || ("".equals("hiapk")))
    {
      HashMap localHashMap7 = new HashMap();
      localHashMap7.put("id", "himarket");
      localHashMap7.put("title", getResources().getString(2131099782));
      localHashMap7.put("desc", getResources().getString(2131099783));
      localHashMap7.put("pic", Integer.valueOf(2130837510));
      localArrayList.add(localHashMap7);
    }
    this.w = localArrayList;
    SimpleAdapter localSimpleAdapter = new SimpleAdapter(this, this.w, 2130903046, arrayOfString, arrayOfInt);
    this.v.setAdapter(localSimpleAdapter);
    this.v.setOnItemClickListener(this.D);
  }

  private void n()
  {
    String str = PreferenceManager.getDefaultSharedPreferences(this).getString("interface_locale", "Auto");
    if (this.p.compareToIgnoreCase(str) == 0);
    do
      label27: return;
    while ((this.p.compareToIgnoreCase("") == 0) && (str.compareToIgnoreCase("Auto") == 0));
    this.p = str;
    if (str.equals("EN"));
    for (Locale localLocale = Locale.US; ; localLocale = Locale.getDefault())
      while (true)
      {
        Resources localResources = getResources();
        Configuration localConfiguration = localResources.getConfiguration();
        DisplayMetrics localDisplayMetrics = localResources.getDisplayMetrics();
        localConfiguration.locale = localLocale;
        localResources.updateConfiguration(localConfiguration, localDisplayMetrics);
        break label27:
        if (str.equals("CHS"))
          localLocale = Locale.SIMPLIFIED_CHINESE;
        if (!(str.equals("CHT")))
          break;
        localLocale = Locale.TRADITIONAL_CHINESE;
      }
  }

  private void o()
  {
    TextView localTextView1 = (TextView)findViewById(2131230720);
    localTextView1.setSingleLine(true);
    SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    this.m.setRegSN(localSharedPreferences.getString("regsn", ""));
    StringBuilder localStringBuilder1 = new StringBuilder(String.valueOf(this.m.getStudyBookName())).append(" ");
    Resources localResources1 = getResources();
    Object[] arrayOfObject1 = new Object[2];
    arrayOfObject1[0] = Long.valueOf(this.m.getTotalIntroducedWords());
    arrayOfObject1[1] = Long.valueOf(this.m.getBookWords());
    StringBuilder localStringBuilder2 = new StringBuilder(String.valueOf(localResources1.getString(2131099763, arrayOfObject1))).append(" ");
    Resources localResources2 = getResources();
    Object[] arrayOfObject2 = new Object[2];
    arrayOfObject2[0] = Long.valueOf(this.m.getTotalLearnedTime() / 60L);
    arrayOfObject2[1] = Long.valueOf(this.m.getTotalLearnedTime() % 60L);
    localTextView1.setText(localResources2.getString(2131099762, arrayOfObject2));
    TextView localTextView2 = (TextView)findViewById(2131230739);
    localTextView2.setSingleLine(true);
    if (this.m.b() == 0)
    {
      str = " IMEI:" + this.q;
      localTextView2.setTextColor(-65536);
      localTextView2.setBackgroundColor(-3355444);
      label274: localTextView2.setText(str);
      a(false);
      return;
    }
    if (this.m.getRegUserName().length() > 0);
    for (String str = " " + getResources().getString(2131099856) + this.m.getRegUserName(); ; str = " " + getResources().getString(2131099855))
    {
      localTextView2.setTextColor(-16776961);
      localTextView2.setBackgroundColor(-3355444);
      break label274:
    }
  }

  private void p()
  {
    String str = null;
    PackageManager localPackageManager = getPackageManager();
    try
    {
      str = localPackageManager.getApplicationInfo("com.sunny.wordstudy", 0).dataDir;
      label19: new StringBuilder(String.valueOf(str)).append("/res/raw/usr_sunny.mp3").toString();
      InputStream localInputStream = getResources().openRawResource(2131034112);
      byte[] arrayOfByte = new byte[1024];
      try
      {
        new File("/sdcard/wordstudy").mkdirs();
        FileOutputStream localFileOutputStream = new FileOutputStream("/sdcard/wordstudy/usr_sunny.edb");
        int i1 = localInputStream.read(arrayOfByte);
        if (i1 == -1)
        {
          localInputStream.close();
          localFileOutputStream.close();
          return;
        }
        localFileOutputStream.write(arrayOfByte, 0, i1);
        int i2 = localInputStream.read(arrayOfByte);
        i1 = i2;
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
      }
    }
    catch (PackageManager.NameNotFoundException localNameNotFoundException)
    {
      break label19:
    }
  }

  private void q()
  {
    switch (this.m.checkStudyDBVer())
    {
    default:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    }
    for (String str = getResources().getString(2131099859); ; str = getResources().getString(2131099860))
      while (true)
      {
        new AlertDialog.Builder(this).setIcon(getResources().getDrawable(2130837511)).setTitle(getResources().getString(2131099826)).setMessage(str).setPositiveButton(getResources().getString(2131099786), new ce(this)).show();
        return;
        str = getResources().getString(2131099858);
        continue;
        str = getResources().getString(2131099859);
      }
  }

  private void r()
  {
    String str = getResources().getString(2131099857);
    new AlertDialog.Builder(this).setIcon(getResources().getDrawable(2130837511)).setTitle(getResources().getString(2131099826)).setMessage(str).setPositiveButton(getResources().getString(2131099786), new cg(this)).show();
  }

  private void s()
  {
    String str = getResources().getString(2131099857);
    new AlertDialog.Builder(this).setIcon(getResources().getDrawable(2130837511)).setTitle(getResources().getString(2131099826)).setMessage(str).setPositiveButton(getResources().getString(2131099786), new ch(this)).show();
  }

  private void t()
  {
    String str = getResources().getString(2131099857);
    new AlertDialog.Builder(this).setIcon(getResources().getDrawable(2130837511)).setTitle(getResources().getString(2131099826)).setMessage(str).setPositiveButton(getResources().getString(2131099786), new ci(this)).show();
  }

  final void a()
  {
    openOptionsMenu();
  }

  public final void a(int paramInt)
  {
    String str1 = getResources().getString(2131099801);
    TelephonyManager localTelephonyManager = (TelephonyManager)getSystemService("phone");
    String str2;
    if (paramInt == 1)
      str2 = localTelephonyManager.getDeviceId();
    while (true)
    {
      if (str2 == null)
        label33: str2 = "";
      String str3;
      String str4;
      if (str1.indexOf(63) > 0)
      {
        str3 = str1 + "&machineid=" + str2;
        str4 = str3 + "&os=android";
      }
      String str6;
      try
      {
        int i1 = ((Integer)Build.VERSION.class.getField("SDK_INT").get(new Build.VERSION())).intValue();
        String str7 = (String)Build.class.getField("MANUFACTURER").get(new Build());
        String str8 = (String)Build.class.getField("MODEL").get(new Build());
        Build.class.getField("DEVICE").get(new Build());
        String str9 = str4 + "&band=" + URLEncoder.encode(new StringBuilder(String.valueOf(i1)).append("_").append(str7).append(str8).toString(), "UTF-8");
        str6 = str9;
        if (!("".equals("")))
          label263: str6 = str6 + "&refercode=";
        startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str6)));
        return;
        if (paramInt == 2)
        {
          String str12 = localTelephonyManager.getSubscriberId();
          if (str12 == null)
            str2 = "";
          str2 = "S" + str12;
        }
        if (paramInt == 3)
        {
          String str10 = ((WifiManager)getSystemService("wifi")).getConnectionInfo().getMacAddress();
          if (str10 == null)
            str2 = "";
          String str11 = "";
          for (int i2 = 0; ; ++i2)
          {
            if (i2 >= str10.length())
              str2 = "N" + str11.toUpperCase();
            if ((str10.charAt(i2) == '-') || (str10.charAt(i2) == ':'))
              continue;
            str11 = str11 + str10.charAt(i2);
          }
        }
        if (paramInt != 4)
          break label564;
        str2 = Stat.c();
        break label33:
        label564: str3 = str1 + "?machineid=" + str2;
      }
      catch (Exception localException)
      {
        String str5 = localException.getMessage();
        System.err.print(str5);
        str6 = str4;
        break label263:
        str2 = "";
        break label33:
      }
    }
  }

  public final void b()
  {
    new AlertDialog.Builder(this).setTitle(getResources().getString(2131099822)).setMessage(getResources().getString(2131099823)).setPositiveButton(getResources().getString(2131099786), new bt(this)).setNegativeButton(getResources().getString(2131099787), new bu(this)).show();
  }

  final void b(int paramInt)
  {
    switch (paramInt)
    {
    default:
    case 0:
    case 1:
    case 2:
    }
    while (true)
    {
      return;
      Intent localIntent3 = new Intent("android.intent.action.SEND");
      localIntent3.setType("plain/text");
      String[] arrayOfString = new String[1];
      arrayOfString[0] = "";
      String str1 = getResources().getString(2131099808);
      String str2 = getResources().getString(2131099809);
      localIntent3.putExtra("android.intent.extra.EMAIL", arrayOfString);
      localIntent3.putExtra("android.intent.extra.SUBJECT", str1);
      localIntent3.putExtra("android.intent.extra.TEXT", str2);
      startActivity(Intent.createChooser(localIntent3, getResources().getString(2131099810)));
      continue;
      Intent localIntent2 = new Intent("android.intent.action.VIEW");
      localIntent2.putExtra("sms_body", getResources().getString(2131099811));
      localIntent2.setType("vnd.android-dir/mms-sms");
      startActivity(localIntent2);
      continue;
      this.A = new bn(this);
      if (this.A.a())
      {
        Intent localIntent1 = new Intent(this, OAuthActivity.class);
        localIntent1.putExtra("from", "wordview");
        startActivityForResult(localIntent1, 5);
      }
      this.A.d();
    }
  }

  public final void c()
  {
    CharSequence[] arrayOfCharSequence = new CharSequence[2];
    arrayOfCharSequence[0] = getResources().getString(2131099796);
    arrayOfCharSequence[1] = getResources().getString(2131099797);
    this.n = 1;
    new AlertDialog.Builder(this).setTitle(getResources().getString(2131099794)).setSingleChoiceItems(arrayOfCharSequence, 0, new bv(this)).setPositiveButton(getResources().getString(2131099798), new bw(this)).setNeutralButton(getResources().getString(2131099799), new bx(this)).setNegativeButton(getResources().getString(2131099800), new by(this)).show();
  }

  public final void c(int paramInt)
  {
    getResources().getString(2131099804);
    String str1 = getResources().getString(2131099679);
    String str2;
    String str3;
    label67: TelephonyManager localTelephonyManager;
    String str5;
    label121: Object localObject1;
    try
    {
      str2 = getResources().getString(2131099802);
      if (str2.indexOf(63) > 0)
      {
        str3 = str2 + "&type=xml&soft=wsandroid&os=android";
        String str4 = str3 + "&build=" + str1;
        localTelephonyManager = (TelephonyManager)getSystemService("phone");
        if (paramInt != 1)
          break label660;
        str5 = localTelephonyManager.getDeviceId();
        break label888:
        String str6 = str4 + "&imei=" + str5;
        if (!("".equals("")))
          str6 = str6 + "&refercode=";
        HttpURLConnection localHttpURLConnection = (HttpURLConnection)new URL(str6).openConnection();
        if (localHttpURLConnection.getResponseCode() != 200)
          break label843;
        InputStream localInputStream = localHttpURLConnection.getInputStream();
        NodeList localNodeList = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(localInputStream).getDocumentElement().getElementsByTagName("response");
        if ((localNodeList == null) || (localNodeList.getLength() <= 0))
          break label828;
        Element localElement1 = (Element)localNodeList.item(0);
        localElement1.getAttribute("result");
        if (localElement1.getElementsByTagName("lic").getLength() <= 0)
          break label813;
        Element localElement2 = (Element)localElement1.getElementsByTagName("lic").item(0);
        localElement2.getAttribute("expire");
        localElement2.getAttribute("lictime");
        localElement2.getAttribute("lastver");
        localElement2.getAttribute("lang");
        localElement2.getAttribute("edition");
        String str8 = localElement2.getAttribute("user");
        localElement2.getAttribute("email");
        String str9 = localElement2.getAttribute("regsn");
        this.u = localElement2.getAttribute("url");
        localElement2.getNodeValue();
        SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
        SharedPreferences.Editor localEditor = localSharedPreferences.edit();
        localEditor.putString("regsn", str9);
        localEditor.putString("reguser", str8);
        localEditor.commit();
        this.m.setRegSN(localSharedPreferences.getString("regsn", ""));
        this.m.setRegUser(localSharedPreferences.getString("reguser", ""));
        localObject1 = getResources().getString(2131099805);
        label900: label910: label660: label536: label541: label813: label828: label843: label884: label888: o();
      }
    }
    catch (Exception localException1)
    {
      int i1;
      while (true)
      {
        try
        {
          Integer.parseInt(str1);
          while (true)
          {
            this.y = new AlertDialog.Builder(this);
            this.y.setIcon(getResources().getDrawable(2130837511));
            this.y.setTitle(getResources().getString(2131099803));
            this.y.setMessage((CharSequence)localObject1);
            this.y.setPositiveButton(getResources().getString(2131099786), new cl(this));
            this.y.show();
            return;
            str3 = str2 + "?type=xml&soft=wsandroid&os=android";
            break label67:
            if (paramInt == 2)
            {
              str5 = localTelephonyManager.getSubscriberId();
              break label888:
            }
            if (paramInt == 3)
            {
              String str10 = ((WifiManager)getSystemService("wifi")).getConnectionInfo().getMacAddress();
              if (str10 != null)
                break label900;
              str5 = "";
              break label888:
              if (i1 >= str10.length())
              {
                str5 = "N" + ((String)localObject2).toUpperCase();
                break label888:
              }
              if ((str10.charAt(i1) == '-') || (str10.charAt(i1) == ':'))
                break label910;
              localObject2 = localObject2 + str10.charAt(i1);
              break label910:
            }
            if (paramInt != 4)
              break label884;
            str5 = Stat.c();
            break label888:
            localObject1 = getResources().getString(2131099804);
            break label536:
            localObject1 = getResources().getString(2131099804);
            continue;
            String str7 = getResources().getString(2131099804);
            localObject1 = str7;
          }
          localException1 = localException1;
          localObject1 = getResources().getString(2131099804);
        }
        catch (Exception localException2)
        {
          break label541:
          str5 = "";
        }
        if (str5 == null);
        str5 = "";
        break label121:
        Object localObject2 = "";
        i1 = 0;
      }
      ++i1;
    }
  }

  public final void d()
  {
    String str1 = "";
    if (this.q.length() > 0)
      str1 = "\nIMEI:" + this.q;
    if (this.r.length() > 0)
      str1 = str1 + "\nIMSI:" + this.r;
    if (this.s.length() > 0)
      str1 = str1 + "\nMAC:" + this.s;
    if (this.t.length() > 0)
      str1 = str1 + "\nCID:" + this.t;
    String str2 = "";
    PackageManager localPackageManager = getPackageManager();
    try
    {
      str2 = localPackageManager.getPackageInfo(getPackageName(), 0).versionName;
      if (str2 != "")
        str2 = " V" + str2;
      String str3 = getResources().getString(2131099757) + str2 + "\nBuild:" + getResources().getString(2131099679) + "\n" + getResources().getString(2131099806) + str1;
      new AlertDialog.Builder(this).setIcon(getResources().getDrawable(2130837511)).setTitle(getResources().getString(2131099824)).setMessage(str3).setPositiveButton(getResources().getString(2131099786), new ca(this)).show();
      return;
    }
    catch (PackageManager.NameNotFoundException localNameNotFoundException)
    {
      localNameNotFoundException.printStackTrace();
    }
  }

  final void e()
  {
    CharSequence[] arrayOfCharSequence = new CharSequence[3];
    arrayOfCharSequence[0] = getResources().getString(2131099813);
    arrayOfCharSequence[1] = getResources().getString(2131099812);
    arrayOfCharSequence[2] = getResources().getString(2131099814);
    this.o = 0;
    new AlertDialog.Builder(this).setTitle(getResources().getString(2131099807)).setSingleChoiceItems(arrayOfCharSequence, 0, new cb(this)).setPositiveButton(getResources().getString(2131099815), new cc(this)).setNegativeButton(getResources().getString(2131099816), new cd(this)).show();
  }

  final void f()
  {
    SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    if (localSharedPreferences.getBoolean("firsttimestudy", true))
    {
      SharedPreferences.Editor localEditor = localSharedPreferences.edit();
      localEditor.putBoolean("firsttimestudy", false);
      localEditor.commit();
      new AlertDialog.Builder(this).setIcon(getResources().getDrawable(2130837511)).setTitle(getResources().getString(2131099864)).setMessage(getResources().getString(2131099865)).setPositiveButton(getResources().getString(2131099786), new cf(this)).show();
    }
    while (true)
    {
      return;
      h();
    }
  }

  public final void g()
  {
    startActivityForResult(new Intent(this, ChooseDBView.class), 3);
  }

  public final void h()
  {
    SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    SharedPreferences.Editor localEditor = localSharedPreferences.edit();
    localEditor.putBoolean("lastlearnmode", true);
    localEditor.commit();
    int i1 = Integer.parseInt(localSharedPreferences.getString("studymode", "0"));
    if (this.m.checkStudyDBVer() != 0)
      q();
    while (true)
    {
      return;
      if (this.m.getTotalLearnTime1(true) > 0L)
        r();
      if (this.m.a(4 - i1))
        s();
      if ((this.m.b() == 0) && (Math.round(1000.0D * Math.random()) % 4L == 0L))
        t();
      startActivityForResult(new Intent(this, StudyView.class), 1);
    }
  }

  public final void i()
  {
    SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    SharedPreferences.Editor localEditor = localSharedPreferences.edit();
    localEditor.putBoolean("lastlearnmode", false);
    localEditor.commit();
    int i1 = 0xF & Integer.parseInt(localSharedPreferences.getString("testmode", "17"));
    if (this.m.checkStudyDBVer() != 0)
      q();
    while (true)
    {
      return;
      if (this.m.getTotalLearnTime1(true) > 0L)
        r();
      if (this.m.b(4 - i1))
        s();
      if ((this.m.b() == 0) && (Math.round(1000.0D * Math.random()) % 4L == 0L))
        t();
      startActivityForResult(new Intent(this, StudyView.class), 1);
    }
  }

  public final void j()
  {
    if ((new File("/sdcard/wordstudy/dict.edb").exists()) || (MDict.getDictCount() > 0))
      startActivityForResult(new Intent(this, DictView.class), 2);
    while (true)
    {
      return;
      this.y = new AlertDialog.Builder(this);
      this.y.setIcon(getResources().getDrawable(2130837511));
      this.y.setTitle(getResources().getString(2131099826));
      this.y.setMessage(getResources().getString(2131099839));
      this.y.setPositiveButton(getResources().getString(2131099786), new cj(this));
      this.y.show();
    }
  }

  public final void k()
  {
    startActivityForResult(new Intent(this, SettingView.class), 4);
  }

  public final void l()
  {
    Object localObject = getResources().getString(2131099849);
    String str1 = getResources().getString(2131099679);
    String str3;
    String str4;
    String str5;
    try
    {
      String str2 = "http://download.exuexi.com/update/wordstudy_android?" + str1 + "_" + this.q + "_c";
      if (this.m.b() > 0)
        str2 = str2 + "_r";
      HttpURLConnection localHttpURLConnection = (HttpURLConnection)new URL(str2).openConnection();
      if (localHttpURLConnection.getResponseCode() == 200)
      {
        InputStream localInputStream = localHttpURLConnection.getInputStream();
        NodeList localNodeList = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(localInputStream).getDocumentElement().getElementsByTagName("response");
        if ((localNodeList != null) && (localNodeList.getLength() > 0))
        {
          Element localElement1 = (Element)localNodeList.item(0);
          Element localElement2 = (Element)localElement1.getElementsByTagName("softupdate").item(0);
          localElement1.getAttribute("result");
          localElement1.getAttribute("expire");
          str3 = localElement2.getAttribute("lastver");
          str4 = localElement2.getAttribute("desc");
          this.u = localElement2.getAttribute("url");
          str5 = localElement2.getNodeValue();
          label305: label368: label498: if (str5 == null)
            str5 = "";
        }
      }
    }
    catch (Exception localException1)
    {
      int i3;
      try
      {
        int i6 = Integer.parseInt(str1);
        i3 = i6;
      }
      catch (Exception localException1)
      {
        int i4;
        int i5;
        try
        {
          int i7 = Integer.parseInt(str3);
          i4 = i3;
          i5 = i7;
          if (i5 <= i4);
        }
        catch (Exception localException1)
        {
          int i2;
          int i1;
          try
          {
            String str8 = getResources().getString(2131099850);
            Object[] arrayOfObject2 = new Object[3];
            arrayOfObject2[0] = str4;
            arrayOfObject2[1] = str3;
            arrayOfObject2[2] = str5;
            String str9 = String.format(str8, arrayOfObject2);
            i2 = i4;
            localObject = str9;
            i1 = i5;
            this.y = new AlertDialog.Builder(this);
            this.y.setIcon(getResources().getDrawable(2130837511));
            this.y.setTitle(getResources().getString(2131099848));
            this.y.setMessage((CharSequence)localObject);
            if (i1 > i2)
            {
              this.y.setPositiveButton(getResources().getString(2131099786), new cm(this));
              this.y.setNegativeButton(getResources().getString(2131099787), new cn(this));
            }
            while (true)
            {
              this.y.show();
              return;
              localException2 = localException2;
              i3 = 0;
              i4 = i3;
              i5 = 0;
              break label305:
              String str6 = getResources().getString(2131099851);
              Object[] arrayOfObject1 = new Object[3];
              arrayOfObject1[0] = str3;
              arrayOfObject1[1] = str4;
              arrayOfObject1[2] = str5;
              String str7 = String.format(str6, arrayOfObject1);
              i2 = i4;
              localObject = str7;
              i1 = i5;
              break label368:
              this.y.setPositiveButton(getResources().getString(2131099786), new co(this));
            }
            localException1 = localException1;
            i1 = 0;
            i2 = 0;
          }
          catch (Exception localException3)
          {
            i1 = i5;
            i2 = i4;
            break label368:
            localException4 = localException4;
            break label498:
            i1 = 0;
            i2 = 0;
          }
        }
      }
    }
  }

  public final void m()
  {
    startActivity(new Intent("android.intent.action.VIEW", Uri.parse(getString(2131099680))));
  }

  protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    super.onActivityResult(paramInt1, paramInt2, paramIntent);
    if (paramInt1 == 12)
      if (paramInt2 == 1)
        Stat.b = 0x2 | Stat.b;
    while (true)
    {
      o();
      return;
      if ((Stat.b != 0) || (Stat.isVoiceFileAvailable()))
        continue;
      this.y = new AlertDialog.Builder(this);
      this.y.setIcon(getResources().getDrawable(2130837511));
      this.y.setTitle(getResources().getString(2131099827));
      this.y.setMessage(getResources().getString(2131099862));
      this.y.setPositiveButton(getResources().getString(2131099786), new ct(this));
      this.y.setNegativeButton(getResources().getString(2131099787), new cu(this));
      this.y.show();
      continue;
      if (paramInt1 == 1)
      {
        this.A = new bn(this);
        if (this.A.c() <= 0)
          continue;
        this.B = this.A.b();
        if (this.B.length() <= 0)
          continue;
        switch (this.A.c())
        {
        default:
          break;
        case 1:
          this.y = new AlertDialog.Builder(this);
          this.y.setIcon(getResources().getDrawable(2130837511));
          this.y.setTitle(getResources().getString(2131099817));
          this.y.setMessage(getResources().getString(2131099818));
          this.y.setPositiveButton(getResources().getString(2131099819), new cv(this));
          this.y.setNegativeButton(getResources().getString(2131099820), new bp(this));
          this.y.setNeutralButton(getResources().getString(2131099821), new bq(this));
          this.y.show();
          break;
        case 2:
        }
        try
        {
          this.A.c(this.B);
        }
        catch (Exception localException)
        {
        }
      }
      n();
    }
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    PreferenceManager.setDefaultValues(this, 2130968576, false);
    setContentView(2130903045);
    n();
    PreferenceManager.getDefaultSharedPreferences(this);
    TelephonyManager localTelephonyManager = (TelephonyManager)getSystemService("phone");
    this.q = localTelephonyManager.getDeviceId();
    if (this.q == null)
      this.q = "";
    this.r = localTelephonyManager.getSubscriberId();
    if (this.r == null);
    for (this.r = ""; ; this.r = "S" + this.r)
    {
      WifiInfo localWifiInfo = ((WifiManager)getSystemService("wifi")).getConnectionInfo();
      this.s = localWifiInfo.getMacAddress();
      if (this.s != null)
        break;
      this.s = "";
      this.t = Stat.c();
      this.m.setIMEI(localTelephonyManager);
      this.m.setMAC(localWifiInfo);
      a(true);
      if (Environment.getExternalStorageState().equals("mounted"))
        break label398;
      this.y = new AlertDialog.Builder(this);
      this.y.setIcon(getResources().getDrawable(2130837511));
      this.y.setTitle(getResources().getString(2131099826));
      this.y.setMessage(getResources().getString(2131099863));
      this.y.setPositiveButton(getResources().getString(2131099822), new bz(this));
      this.y.show();
      label260: return;
    }
    String str = "";
    for (int i1 = 0; ; ++i1)
    {
      if (i1 >= this.s.length())
        this.s = "N" + str.toUpperCase();
      if ((this.s.charAt(i1) == '-') || (this.s.charAt(i1) == ':'))
        continue;
      str = str + this.s.charAt(i1);
    }
    if (new File("/sdcard/wordstudy/dict.edb").exists())
      label398: this.m.setDict("/sdcard/wordstudy/dict.edb");
    this.z = ProgressDialog.show(this, getResources().getString(2131099825), getResources().getString(2131099835), true);
    this.x = new AlertDialog.Builder(this);
    this.x.setIcon(getResources().getDrawable(2130837511));
    this.x.setTitle(getResources().getString(2131099827));
    this.x.setMessage(getResources().getString(2131099852));
    this.x.setPositiveButton(getResources().getString(2131099786), new ck(this));
    this.y = new AlertDialog.Builder(this);
    this.y.setIcon(getResources().getDrawable(2130837511));
    this.y.setTitle(getResources().getString(2131099827));
    this.y.setMessage(getResources().getString(2131099862));
    this.y.setPositiveButton(getResources().getString(2131099786), new cp(this));
    this.y.setNegativeButton(getResources().getString(2131099787), new cq(this));
    this.C = Stat.a(this);
    Stat.a(this);
    if ((!(this.C)) && (Stat.b <= 0));
    for (int i2 = 0; ; i2 = 1)
    {
      this.C = i2;
      new cr(this).start();
      break label260:
    }
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    super.onCreateOptionsMenu(paramMenu);
    paramMenu.add(0, 0, 0, getResources().getString(2131099829));
    paramMenu.add(0, 1, 1, getResources().getString(2131099834));
    paramMenu.add(0, 2, 2, getResources().getString(2131099831));
    paramMenu.add(0, 3, 3, getResources().getString(2131099833));
    paramMenu.add(0, 4, 4, getResources().getString(2131099832));
    return true;
  }

  protected void onDestroy()
  {
    Stat.deinit();
    super.onDestroy();
    Process.killProcess(Process.myPid());
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    switch (paramMenuItem.getItemId())
    {
    default:
    case 0:
    case 3:
    case 2:
    case 1:
    case 4:
    }
    while (true)
    {
      return true;
      new AlertDialog.Builder(this).setTitle(getResources().getString(2131099853)).setMessage(getResources().getString(2131099854)).setPositiveButton(getResources().getString(2131099786), new br(this)).setNegativeButton(getResources().getString(2131099787), new bs(this)).show();
      continue;
      d();
      continue;
      l();
      continue;
      k();
      continue;
      b();
    }
  }
}

/* Location:           E:\Desktop\Android\wordstd\classes_dex2jar.jar
 * Qualified Name:     com.sunny.wordstudy.Word
 * JD-Core Version:    0.5.3
 */